<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
<head>
	   <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link href="${path}/statics/weui/style/weui.css" rel="stylesheet"/>
		<link href="${path}/statics/weui/style/weui2.css" rel="stylesheet"/>
		<link href="${path}/statics/weui/style/weui3.css" rel="stylesheet"/>
		<link href="${path}/statics/css/wap.css" rel="stylesheet">
<title>用户注册页面</title>
</head>
<body>
<div class="page-title"><h3>欢迎注册</h3></div>
<form id="form1"  action="${path}/Weixin/save">
<input type="hidden" id="openid" name="openid" value="${openid}">
	  <div class="weui_cells weui_cells_form">
        <div class="weui_cell" id="dName">
            <div class="weui_cell_hd"><label class="weui_label">微信名称</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input name" type="text" name="nickname" id="name" placeholder="输入微信名称" >
            </div>
            <i id="iconWarn"></i>
            <div class="weui_cell_ft">
                <i class="weui_icon_warn"></i>
            </div>
        </div>
        <div class="weui_cell" id="dName">
            <div class="weui_cell_hd"><label class="weui_label">手机号码</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input email" type="text" name="phone" id="phone" placeholder="请输入正确的手机号" >
            </div>
            <i id="iconWarn"></i>
            <div class="weui_cell_ft">
                <i class="weui_icon_warn"></i>
            </div>
        </div>
        
              <div class="weui_cells_title">性别</div>
        <div class="weui_cells weui_cells_checkbox">
            <label class="weui_cell weui_check_label" for="s11">
                <div class="weui_cell_hd">
                <input type="radio" class="weui_check" name="sex" value="1" id="s11" checked="checked">
                    <i class="weui_icon_checked"></i>
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <p>男</p>
                </div>
            </label>
            <label class="weui_cell weui_check_label" for="s12">
                <div class="weui_cell_hd">
            <input type="radio" name="sex" value="2" class="weui_check" id="s12">
                    <i class="weui_icon_checked"></i>
                </div>
                <div class="weui_cell_bd weui_cell_primary">
                    <p>女</p>
                </div>
            </label>
        </div>
    </div>
	<a id="nextBtn" class="weui_btn weui_btn_primary" href="javascript:;">注册</a>
	<!-- +++++++++++++++++++++++++++++++ -->
	</form>
	<script src="${path}/statics/libs/jquery.min.js" type="text/javascript"></script>
	
	<script> 
	
		//显示提示框，目前三个参数(txt：要显示的文本；time：自动关闭的时间（不设置的话默认1500毫秒）；status：默认0为错误提示，1为正确提示；)
		function showTips(txt,time,status)
		{
			var htmlCon = '';
			if(txt != ''){
				if(status != 0 && status != undefined){
					htmlCon = '<div class="tipsBox" style="width:220px;padding:10px;background-color:#4AAF33;border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;color:#fff;box-shadow:0 0 3px #ddd inset;-webkit-box-shadow: 0 0 3px #ddd inset;text-align:center;position:fixed;top:5%;left:50%;z-index:999999;margin-left:-120px;">'+txt+'</div>';
				}else{
					htmlCon = '<div class="tipsBox" style="width:220px;padding:10px;background-color:#D84C31;border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;color:#fff;box-shadow:0 0 3px #ddd inset;-webkit-box-shadow: 0 0 3px #ddd inset;text-align:center;position:fixed;top:5%;left:50%;z-index:999999;margin-left:-120px;">'+txt+'</div>';
				}
				$('body').prepend(htmlCon);
				if(time == '' || time == undefined){
					time = 1500; 
				}
				setTimeout(function(){ $('.tipsBox').remove(); },time);
			}
		}
		
		$(function(){
			//AJAX提交以及验证表单
			$('#nextBtn').click(function(){
				var name=$('.name').val();
				var email = $('.email').val();
				/* var passwd = $('.passwd').val();
				var passwd2 = $('.passwd2').val(); */
				var verifyCode = $('.verifyCode').val();
				var EmailReg = /^1[3|4|5|8][0-9]\d{4,8}$/; //号码正则
				if(name==''){
					showTips('请输入微信名称~');
				}
				if(email == ''){
					showTips('请填写您的手机号码~');
				}else if(!EmailReg.test(email)){
					showTips('您的号码格式错咯~');
				}
				else{
					document.getElementById("form1").submit();
				  //  window.location.href = '你的跳转的目标地址';
				//	showTips('提交成功~ 即将进入下一步',2500,1);
					//此处省略 ajax 提交表单 代码...
				}
			});
			
		
		});
	</script>
</body>
</html>